dofile("libContextMenu.lua")

choices = {
	"Menu1",
	"Menu2",
	"Menu3",
	"LongestMenu",
	"Folder1", {
		"Menu1Longest",
		"Me2",
		"M3",
		"Folder1", {
			"Menu1",
			"Me2",
			"M3"
		},
	},
	"Menu4",
	"Folder2", {
		"Menu1",
		"Me2",
		"M3"
	},
	"Menu5"
}

cm1 = ContextMenu.new(0, 0, choices)

while not Keys.held.Start do
	Controls.read()
	
	local id, lv, type = cm1:getInfos()
	
	startDrawing()
		
		cm1:draw()
		screen.drawTextBox(SCREEN_UP, 5, 5, 256, 192, "ID : "..id.." / LV : "..lv.." / TYPE : "..type.."\nClick anywhere on the screen to display the menu !")
		
		--[[if Stylus.newPress and not cm1:getVisible() then
			cm1:move(Stylus.X, Stylus.Y)
			cm1:setVisible()
		end]]
		cm1:setVisible()
		
	stopDrawing()
	
end

cm1:clear()
